package cn.bigway.app.weavingdesigner.main;

import javax.swing.JMenuItem;

import cn.bigway.app.weavingdesigner.action.WdActionFactory;
import cn.bigway.app.weavingdesigner.type.WdMenuItemType;
import cn.bigway.app.weavingdesigner.util.WdBaseFactory;

final class WdMenuItemFactory extends WdBaseFactory<JMenuItem, WdMenuItemType> {
	private static final WdMenuItemFactory instance = new WdMenuItemFactory();

	private WdMenuItemFactory() {
		//
	}

	public static WdMenuItemFactory getInstance() {
		return instance;
	}

	@Override
	protected JMenuItem create(WdMenuItemType type) {
		JMenuItem menuItem = new JMenuItem();
		menuItem.setAction(WdActionFactory.getInstance().get(type));
		return menuItem;
	}
}
